<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  
  <script type="module">
    import { reactive, effect } from './reactivity/index.js'

    const m = new Map([
      [{key: 1}, {value: 1}]
    ])
    const p = reactive(m)

    const key = {key: 1}
    const value = new Set([1,2,3])
    const p1 = reactive(new Map([
      [key, value],
    ]))
    const p2 = reactive(new Map([
      ['key', 1]
    ]))
    const s = reactive(value)

    effect(() => {
      // p.forEach((value, key) => {
      //   console.log(value)
      //   console.log(key)
      // })
      // p1.forEach((value, key) => {
      //   console.log(value.size)
      // })
      // p2.forEach((val, key) => {
      //   console.log(val)
      // })

      // s.forEach((val) => {
      //   console.log(val)
      // })

      // for (const [key, value] of p2) {
      //   console.log(key, value)
      // }
      console.log(p2.entries())
      for (const [key, value] of p2.entries()) {
        console.log(key, value)
      }
    })

    // p.set({key: 2}, {value: 2})
    // p1.get(key).delete(1)
    p2.set('key1', 2)

    // s.add(4)
  </script>
</body>
</html>
